package com.xx.ems.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * @author xxx
 * @date 2014-2-25
 * @version 1.0
 * 描述: 设备日志表
 */
@Entity
public class Elog {
	/**
	 * 描述：主键
	 */
	private Integer lid;
	/**
	 * 描述：设备表关联对象
	 */
	private Equipments equipments;
	/**
	 * 描述：用户表关联对象 (操作人)
	 */
	private Users users;
	/**
	 * 描述：操作时间
	 */
	private Date update_time;
	/**
	 * 描述：操作类型 (1：添加, 2：修改, 3：删除)
	 */
	private int update_type;
	/**
	 * 描述：操作内容
	 */
	private String update_content;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="lid",unique=true,nullable=false)
	public Integer getLid() {
		return lid;
	}
	public void setLid(Integer lid) {
		this.lid = lid;
	}
	@ManyToOne(targetEntity=Equipments.class)
	@JoinColumn(name="fk_eid")
	public Equipments getEquipments() {
		return equipments;
	}
	public void setEquipments(Equipments equipments) {
		this.equipments = equipments;
	}
	@ManyToOne(targetEntity=Users.class)
	@JoinColumn(name="fk_uid")
	public Users getUsers() {
		return users;
	}
	public void setUsers(Users users) {
		this.users = users;
	}
	@Column(name="update_time",nullable=false)
	public Date getUpdate_time() {
		return update_time;
	}
	public void setUpdate_time(Date update_time) {
		this.update_time = update_time;
	}
	@Column(name="update_type",nullable=false)
	public int getUpdate_type() {
		return update_type;
	}
	public void setUpdate_type(int update_type) {
		this.update_type = update_type;
	}
	@Column(name="update_content",length=255,nullable=false)
	public String getUpdate_content() {
		return update_content;
	}
	public void setUpdate_content(String update_content) {
		this.update_content = update_content;
	}
}